﻿using System;
using System.Collections.Generic;
using System.Text;

namespace HR.Appointments.Service.Tools
{
    internal class DateUtils
    {
        public static DayOfWeek IntToDayOfWeek(int dayId)
        {
            switch (dayId)
            {
                case 1: return DayOfWeek.Monday;
                case 2: return DayOfWeek.Tuesday;
                case 3: return DayOfWeek.Wednesday;
                case 4: return DayOfWeek.Thursday;
                case 5: return DayOfWeek.Friday;
                case 6: return DayOfWeek.Saturday;
                case 7: return DayOfWeek.Sunday;
                default:
                    return DayOfWeek.Monday;
                //throw new ServiceException();
            }
        }
        

        public static int DayOfWeekToInt(DayOfWeek dayOfWeek)
        {
            switch (dayOfWeek)
            {
                case DayOfWeek.Monday: return 1;
                case DayOfWeek.Tuesday: return 2;
                case DayOfWeek.Wednesday: return 3;
                case DayOfWeek.Thursday: return 4;
                case DayOfWeek.Friday: return 5;
                case DayOfWeek.Saturday: return 6;
                case DayOfWeek.Sunday: return 7;
                default :
                    return 1;
                    //throw new ServiceException();
            }
        }

		public static string IntToDayOfWeekIceland(int dayId)
		{
			switch (dayId)
			{
				case 1: return "Mánudagur";
				case 2: return "Þriðjudagur";
				case 3: return "Miðvikudagur";
				case 4: return "Fimmtudagur";
				case 5: return "Föstudagur";
				case 6: return "Laugardagur";
				case 7: return "Sunnudagur";
				default:
					return "Mánudagur";
				//throw new ServiceException();
			}
		}
    }
}
